package com.example.demo.signin.controller;

import com.example.demo.signin.service.ISignInService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ******************************************************
 *
 * @author liugh9
 * @version 1.0
 * @classname SignInController
 * @description
 * @date 2023/07/11 9:34
 * <p>
 * ******************************************************
 */
@RestController
@RequestMapping("/sign")
public class SignInController {

    @Autowired
    public ISignInService signInService;


    @GetMapping("/in/{userId}/{day}")
    public Boolean signIn(@PathVariable(value = "userId") Long userId, @PathVariable(value = "day") Integer day) {
        return signInService.sign(userId, day);
    }


    @GetMapping("/count/{userId}")
    public String signCount(@PathVariable(value = "userId") Long userId) {
        return signInService.signCount(userId);
    }
}
